<?php
class BxpayreturnAction extends BaseAction {

    public function index(){
        $order_no = I('get.order_no');
        $map['bx_no'] = $order_no;
        $list = M('Baoxian')->where($map)->find();
        if ($list) {
            $agent = $_SERVER['HTTP_USER_AGENT']; 
            if(strpos($agent,"icroMessenger")) {
                $this->assign('isWeixn','1');
            }
            $this->display();
        }else{
            exit('订单不存在');  
        }                
    }

    public function wxnotice(){
        $order_no = I('get.order_no');
        $map['bx_no'] = $order_no;
        $list = M('Baoxian')->where($map)->find();
        if ($list) {
            if ($list['payStatus']==0) {
                //更新订单状态
                M('Baoxian')->where($map)->setField('payStatus',1);
            }
        }             
    }
}